<pre>
<?php
include_once('RAWhtml-parser-config.inc.php');

$db = mysql_connect(HOST, LOGIN, PASSWORD)
or die (file_put_contents(ERRLOG, mysql_error()."\r\n", FILE_APPEND));
mysql_select_db(DBNAME, $db) or die (file_put_contents(ERRLOG, mysql_error()."\r\n", FILE_APPEND));

	$res = mysql_query("SELECT cid, currname, rate, units, date FROM currency_rate ORDER BY date",$db);
	echo $numrows = mysql_num_rows($res);

	// Собственно вывод данных
	$curdate = 0;
	for ($it=0; $it<$numrows; $it++){
		$selection = mysql_fetch_array($res, MYSQL_ASSOC);
		$datetime = date("d/m/Y", $selection['date']);
		if ($selection['date'] != $curdate){
			$curdate = $selection['date'];
			echo "<hr><h3>$datetime</h3>";
		}
		echo <<<LABEL
		<p style="margin:-23px 20px">Стоимость <b>$selection[cid] <i>{$selection['rate']}</i> руб.</b> за $selection[units]</p>
		<br>
LABEL;
	}
	mysql_close($db);


?>
</pre>